﻿
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace DefenseQuestion.Repositorys
{
    public interface IBaseRepository<T> where T : class
    {
        DbSet<T> ety { get; }
        T Add(T entity);
        Task<T> AddAsync(T entity);
        Task<int> AddManyAsync(List<T> entities);
        Task<int> DeleteAsync(Expression<Func<T, bool>> where);
        Task<int> DeleteAsync(int Id);
        Task<int> DeleteAsync(List<T> entities);
        Task<bool> ExistsAsync(Expression<Func<T, bool>> where);
        Task<T> FindAsync(Expression<Func<T, bool>> where);
        Task<T> FindAsync(int Id);
        Task<List<T>> QuerAsync();
        Task<List<T>> QuerAsync(Expression<Func<T, bool>> where);
        IQueryable<T> Queryable();
        Task<T> UpdateAsync(T entity);
    }
}